import Api from './api'

class FactoryUserApi extends Api {
  updateStatus ({ id, enable }) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/enable/${id}`,
      method: 'put',
      data: { enable }
    })
  }

  resetPassword ({ id, password, confirmPassword }) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/resetPassword/${id}`,
      method: 'put',
      data: { password, confirmPassword }
    })
  }

  checkAccount (account) {
    return this.request({
      url: `${this.servicePath}/${this.modulePath}/checkAccount/${account}`,
      method: 'get'
    })
  }
}

export default new FactoryUserApi('factory/factoryUser')
